package fr.jhaccoun.demenager_eco.utilisateur;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;

import org.springframework.security.core.GrantedAuthority;

/**
 * The persistent class for the ROLE database table.
 * 
 */
@Entity
@Table(name = "ROLE")
public class Role implements GrantedAuthority {

	private static final long serialVersionUID = 1L;

	@Id
	@GeneratedValue(strategy = GenerationType.AUTO)
	@Column(name = "ROLE_ID")
	private Long idRole;

	@Column(name = "DESCRIPTION")
	private String description;

	@Column(name = "TYPE_ROLE")
	private String typeRole;

	//TODO Voir si ces constructeurs servent
	public Role() {
	}

	public Role(String typeRole, String description) {
		super();
		this.typeRole = typeRole;
		this.description = description;
	}

	public Role(String typeRole) {
		super();
		this.typeRole = typeRole;
		this.description = typeRole;
	}

	public Long getIdRole() {
		return this.idRole;
	}

	public void setIdRole(Long idRole) {
		this.idRole = idRole;
	}

	public String getDescription() {
		return this.description;
	}

	public void setDescription(String description) {
		this.description = description;
	}

	public String getTypeRole() {
		return this.typeRole;
	}

	public void setTypeRole(String typeRole) {
		this.typeRole = typeRole;
	}

	@Override
	public String getAuthority() {
		return typeRole;
	}
 
}